<template>
  <view class="dtail-img">
    <view v-for="(item, index) in imgs" @click="handleClick(index)">
      <TImage :key="item" :src="item" width="200rpx" height="200rpx" borderRadius="16rpx"></TImage>
    </view>
  </view>
</template>
<script setup lang="ts">
  import TImage from '@/components/TImage/index.vue';
  import type { PropType } from 'vue';

  const props = defineProps({
    imgs: {
      type: Array as PropType<string[]>,
      default: () => [],
    },
  });
  const handleClick = (index: number) => {
    uni.previewImage({ current: index, urls: props.imgs });
  };
</script>
<style lang="scss" scoped>
  .dtail-img {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8rpx;
  }
</style>
